package com.adnaan.backend.entity;

import com.adnaan.backend.entity.dto.OptionDto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * author: adnaan
 * create: 2025-02-19 13:05
 * Description:
 */
@Data
@Tag(name = "科普文章表")
@TableName("general_article")
@EqualsAndHashCode(callSuper = true)
public class Article extends BaseEntity {

    @Schema(title = "标题", description = "")
    private String title;

    @Schema(title = "封面", description = "")
    private String cover;

    @Schema(title = "简介", description = "")
    private String description;

    @Schema(title = "内容", description = "")
    private String content;

    @Schema(title = "浏览量", description = "")
    private Integer pageView;

    @Schema(title = "点赞数", description = "")
    @TableField(exist = false)
    private Integer likeCount;

    @Schema(title = "收藏数", description = "")
    @TableField(exist = false)
    private Integer collectCount;

    @Schema(title = "标签", description = "")
    @TableField(exist = false)
    private List<OptionDto> tags;

    @Schema(title = "是否点赞", description = "")
    @TableField(exist = false)
    private boolean liked;

    @Schema(title = "是否收藏", description = "")
    @TableField(exist = false)
    private boolean collected;

    @Schema(title = "评论", description = "")
    @TableField(exist = false)
    private List<UserComment> comments;

    @Schema(title = "推荐分数", description = "用于推荐系统排序")
    @TableField(exist = false)
    private Double recommendScore;

    @Schema(title = "标签id", description = "")
    @TableField(exist = false)
    private String tagIds;

    @Schema(title = "进度", description = "")
    @TableField(exist = false)
    private Integer process;
}
